begin
  inp = File.new("ex4in.txt","r")
  out = File.new("ex4out.txt", "w")
  out.print(inp.gets.swapcase)
  
  rescue => err
    if (inp == nil)
        puts ("file not found")
    end
end